import HttpService from "@/api";
import type { DeptItem } from "@/typings/dept";

/**
 * @description 获取部门列表
 * @param params
 * @returns DeptItem[]
 */
export const deptListApi = (params: any) => HttpService.get<DeptItem[]>(`/system/dept/list`, { params });

/**
 * @description 新增部门
 * @param params
 * @returns DeptItem[]
 */
export const addDeptApi = (params: DeptItem) => HttpService.post<DeptItem[]>(`/system/dept`, params);

/**
 * @description 修改部门
 * @param params
 * @returns DeptItem[]
 */
export const updateDeptApi = (params: DeptItem) => HttpService.put<DeptItem[]>(`/system/dept`, params);

/**
 * @description 删除部门
 * @param id
 * @returns DeptItem[]
 */
export const delDeptApi = (id: number) => HttpService.delete<DeptItem[]>(`/system/dept/${id}`);

/**
 * @description 获取部门详细数据
 * @param deptId
 * @returns DeptItem[]
 */
export const getDeptByIdApi = (deptId: number) => HttpService.get<any>(`/system/dept/${deptId}`);
